home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmCT_1014_CTable < prev    next >
Encoding:
Text File  |  1992-04-08  |  3.2 KB  |  141 lines

  1. %case include%
  2.     %if classname = CTable%
  3.         #include <CAMTable.h>
  4.     %else%
  5.         #include "%classname%.h"
  6.     %endif%
  7. %case include.override%
  8.     %if classname = CTable%
  9.         #include <CAMTable.h>
  10.     %endif%
  11. %case classDecl%
  12.     %if classname = CTable%
  13.         class CAMTable;
  14.     %else%
  15.         class %classname%;
  16.     %endif%
  17. %case instance%
  18.     %if classname = CTable%
  19.         CAMTable            *%itemname%;
  20.     %else%
  21.         %classname%%        %*%itemname%;
  22.     %endif%
  23. %case create%
  24.     
  25.     %if classname = CTable%
  26.         %itemname% = New%itemname% ();
  27.     %else%
  28.         %itemname% = new %classname%;
  29.     %endif%
  30.     %itemname%->IViewRes ('%paneType%', %paneID%, %enclosure%, supervisor);
  31.     %if defined itsPanorama%
  32.         %set itsPanorama = itemname%
  33.     %endif%
  34. %case zAuxiliaryMethod.decl%
  35.     %if classname = CTable%
  36.         virtual CAMTable    *New%itemname%        (void);
  37.     %endif%
  38. %case zAuxiliaryMethod%
  39.     %if classname = CTable%
  40.         /*----------*/
  41.         // The only purpose of this function is so that you can override it
  42.         // to create the list as your subclass of CAMTable
  43.     
  44.         %if window%
  45.             CAMTable    *Z%windname%::New%itemname%    (void)
  46.         %else%
  47.             CAMTable    *Z%dlogname%::New%itemname%    (void)
  48.         %endif%
  49.         {
  50.             CAMTable        *theList;
  51.         
  52.             theList = new CAMTable;
  53.             return (theList);
  54.         
  55.         } /* New%itemname% */
  56.     
  57.     %endif%
  58. %case auxiliaryClass%
  59.     %if classname = CTable%
  60.         /*----------*/
  61.         class C%itemname% : public CAMTable {
  62.         public:
  63.             void    IViewTemp        (CView            *anEnclosure,
  64.                                      CBureaucrat    *aSupervisor,
  65.                                      Ptr            viewData);        // is override
  66.             void    GetCellText        (Cell            aCell,
  67.                                      short            availableWidth,
  68.                                      StringPtr        itsText);        // is override
  69.         }; /* C%itemname% */
  70.     
  71.     %endif%
  72. %case auxiliaryMethod.decl%
  73.     %if classname = CTable%
  74.         CAMTable    *New%itemname%        (void);        // is override
  75.     %endif%
  76. %case auxiliaryMethod%
  77.     %if classname = CTable%
  78.         /*----------*/
  79.         void    C%itemname%::IViewTemp%    %(CView            *anEnclosure,
  80.                                          CBureaucrat    *aSupervisor,
  81.                                          Ptr            viewData)
  82.         {
  83.             inherited::IViewTemp (anEnclosure, aSupervisor, viewData);
  84.         
  85.             // any additional initialization for your subclass
  86.             AddRow (4, 0);        // e.g., add 4 rows at the beginning of the list
  87.         
  88.         } /* IViewTemp */
  89.     
  90.         /*----------*/
  91.         void    C%itemname%::GetCellText%    %(Cell            aCell,
  92.                                              short            availableWidth,
  93.                                              StringPtr        itsText)
  94.         {
  95.             // replace with your own code which uses the cell coordinates
  96.             // to access your private data structures,
  97.             // then convert the cell data to a Str255
  98.         
  99.             switch (aCell.v) {
  100.                 case 0:
  101.                         CopyPString ("\pOne", itsText);
  102.                     break;
  103.                 case 1:
  104.                         CopyPString ("\pTwo", itsText);
  105.                     break;
  106.                 case 2:
  107.                         CopyPString ("\pThree", itsText);
  108.                     break;
  109.                 default:
  110.                         CopyPString ("\pInfinity", itsText);
  111.                     break;
  112.             }; /* switch */
  113.         
  114.         } /* GetCellText */
  115.     
  116.         /*----------*/
  117.         // This overrides the parent's New%itemname% to create a subclass of CAMTable
  118.         
  119.         %if window%
  120.             CAMTable    *C%windname%::New%itemname%    (void)
  121.         %else%
  122.             CAMTable    *C%dlogname%::New%itemname%    (void)
  123.         %endif%
  124.         {
  125.             C%itemname%            *theList;
  126.         
  127.             theList = new C%itemname%;
  128.             return (theList);
  129.         
  130.         } /* New%itemname% */
  131.     
  132.     %endif%
  133. %case ProviderChanged%
  134.     if (aProvider == %itemname%) {
  135.         if (%itemname%->HasSelection ()) {
  136.             // perhaps activate some buttons
  137.         } else {
  138.             // perhaps deactivate
  139.         }
  140.     }
  141.